<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .preview-container{
            width: 1226px;
            margin:50px auto;
            display: flex;
        }
        .preview-container .preview-wapper{
            width: 400px;
            margin-right: 20px;
        }
        .preview-container .preview-wapper .preview{
            width: 400px;
            height: 400px;
            background-color: orange;
            position: relative;
        }
        .preview-container .preview-wapper .preview .shadow{
            width: 200px;
            height: 200px;
            background-color: rgba(0,0,0,0.5);
            position: absolute;
            left: 0;
            top: 0;
        }
        .preview-container .preview-info{
            flex: 1;
            background-color: aquamarine;
        }
    </style>
</head>
<body>
    <div class="preview-container">
        <div class="preview-wapper">
            <div class="preview">
                <div class="shadow"></div>
            </div>
            <ul class="preview-list">
                <li><img src="" alt=""></li>
                <li><img src="" alt=""></li>
                <li><img src="" alt=""></li>
                <li><img src="" alt=""></li>
            </ul>
        </div>
        <div class="preview-info">

        </div>
    </div>  
</body>
<script>
    var preview = document.getElementsByClassName("preview")[0];
    var shadow = document.getElementsByClassName("shadow")[0];


    preview.onmousemove = function(e){
        var e = e || window.event;
        var x = e.pageX - preview.offsetLeft;
        var y = e.pageY - preview.offsetTop;

        shadow.style.left = x + "px";
        shadow.style.top = y + "px";

    }

</script>
</html>